import PropTypes from 'prop-types'
import React, { memo } from 'react'
import HomeLongforWrapper from './style'
import SectionHeader from '@/components/section-header'
import ScrollView from '@/base-ui/scroll-view'
import HomeLongforItem from '@/components/longfor-item'


const HomeLongfor = memo((props) => {
  const {itemData} = props
  return (
    <HomeLongforWrapper>
      <SectionHeader title={itemData.title} subtitle={itemData.subtitle}/>
      <div className='long-list'>
      <ScrollView>
        {
          itemData.list.map((item) => {
            // 把每一个对象用item封装
            return <HomeLongforItem forData={item} key={item.city}/>
          })
        }
        </ScrollView>
        </div>
    </HomeLongforWrapper>
  )
})

HomeLongfor.propTypes = {
  itemData: PropTypes.object
}

export default HomeLongfor